//
//  TopRecvXml.m
//  yuimall_Iphone
//
//  Created by yuike6 yuike6 on 12-4-14.
//  Copyright (c) 2012年 yuike. All rights reserved.
//

#import "TopRecvXml.h"
#import "header.h"

@implementation TopRecvXml
@synthesize xmlTree = xmlTree_;

-(void) dealloc
{
    YRelease(xmlTree_);
    [super dealloc];
}

-(id) initWithXmlTree:(XMLParsedTree *) tree
{    
    if(!tree)
    {
        return nil;
    }
    
    self = [self init];
    if(self)
    {
        self.xmlTree = tree;
    }

    return self;
}

-(id) initWithXmlString:(NSString *) xmlString
{
    if ([NSString isNilOrEmpty:xmlString]) {
        return nil;
    }
    
    self = [self init];
    if(self)
    {
        self.xmlTree = [XMLParser XMLParsedTreeFromURLString:xmlString];
    }
    
    return self;
}

-(id) initWithXmlData:(NSData *) xmlData
{
    if (!xmlData) {
        return nil;
    }
    
    self = [self init];
    if(self)
    {
        self.xmlTree = [XMLParser XMLParsedTreeFromData:xmlData];
    }
    
    return self;
}
@end
